const {Schema, model} = require('mongoose');

const postSchema = new Schema({
    title: {type: String, required: true},
    contact: {type: String},
    description: {type: String, required: true},
    creator: {type: Schema.Types.ObjectId, ref: 'User'},
    email: {type: String},
    status: {type: String, enum: ['applied', 'approved', 'failed'], default:'applied'},
    agree: {type: Boolean, default: true},
    deadline: {type: String},
    wages: {type: String, required: true},
    views: {type: Number, default: 0},
    applies: {type: Number, default: 0}
}, {timestamps: true})

module.exports = model('Post', postSchema);